package com.audaque.springboot.foshanupload.web.httpclientdemo.ieg.product.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

/**
 * 共用req,rsp
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
public class IegProduct implements Serializable {
    private static final long serialVersionUID = -1242493306307174690L;

    private String code;
    private String msg;

    public String getId() {
        if(StringUtils.isNotBlank(id)){
            return id;
        }else   if(en!=null&&StringUtils.isNotBlank(en.getId())){
            return en.getId();
        }else   if(ja!=null&&StringUtils.isNotBlank(ja.getId())){
            return ja.getId();
        }else   if(zh!=null&&StringUtils.isNotBlank(zh.getId())){
            return zh.getId();
        }
        return null;

    }

    private String id;
    private IegLanguage zh;
    private IegLanguage en;
    private IegLanguage ja;
}
